<div id="purapp-list-detail">
	<div id="purapp-goods">
		<?php foreach ($purapp_detail['pur_app_goods'] as $g) { ?>
		<div class="ajax-goods">
			<div class="ajax-number"><?php echo $g->sub_goods_id; ?></div>
			<div class="ajax-scode"></div>
			<div class="ajax-pro"></div>
			<div class="ajax-quantity"><?php echo $g->quantity; ?> 件</div>
		</div>
		<?php } ?>
	</div>
	<?php if (1 == $purapp_detail['pur_app_status']) { ?>
	<div id="purapp-action">
		<input type="hidden" name="pur_app_id" value="<?php echo $purapp_detail['pur_app_id']; ?>" />
		<a href="javascript:void(0)" target="_blank" id="confirm">进货</a>
		<a href="javascript:void(0)" id="denied">不通过</a>
	</div>
	<?php } ?>
	<div class="clear"></div>
</div>
<script type="text/javascript">
$('#denied').click(function(){
	pur_app_id = $(this).siblings('input').val();
	purchase.action.denied(pur_app_id, function(){
		$('#purapp-action').remove();
		$('#purapp-list-detail').prev().children('.status').html('<span class="c-red">不通过</span>');
	});
});
$('#confirm').click(function(){
	pur_app_id = $(this).siblings('input').val();
	purchase.action.confirm(pur_app_id);
});
</script>

<?php //var_dump($purapp_detail['pur_app_goods']) ?>